Skip to content

DOC-13093-Write-a-tutorial-for-SQL-migration (Couchbase Server) #328

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: release/7.6
Choose a base branch
from

Conversation

RayOffiah
Copy link
Contributor

Description

This pull request updates the SQL migration tutorial with comprehensive instructions, examples, and enhancements. Key changes include:

  • Added detailed steps for migrating SQL data to a document model, using student-course data as a case study.
  • Updated the enrollment schema to include a 'score' field to reflect changes in the data model.
  • Included examples for JSON structuring during Couchbase imports.
  • Provided diagrams and illustrations for clearer guidance.
  • Added references to MySQL JSON functions for additional context.
  • Revised headers for consistency and provided preview updates.
  • Introduced a new tutorial page and updated navigation.

Checklist

  • I have manually tested my changes to ensure functionality and correctness.
  • I have added appropriate documentation or updated existing descriptions where necessary.

Preview

https://preview.docs-test.couchbase.com/docs-devex-DOC-13093-Write-a-tutorial-for-SQL-migration/server/current/tutorials/migration-tutorial/sql-migration-tutorial.html

@RayOffiah RayOffiah requested a review from a team March 14, 2025 10:09
@RayOffiah RayOffiah self-assigned this Mar 14, 2025
@RayOffiah RayOffiah added documentation Improvements or additions to documentation enhancement New feature or request labels Mar 14, 2025
@RayOffiah RayOffiah force-pushed the DOC-13093-Write-a-tutorial-for-SQL-migration branch 2 times, most recently from f3d87fe to e94fc10 Compare March 17, 2025 09:07
Copy link
Contributor

@simon-dew simon-dew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't had time to work through the content, but I have feelings about where this should go in the information architecture

@RayOffiah RayOffiah force-pushed the DOC-13093-Write-a-tutorial-for-SQL-migration branch from e94fc10 to ae12c0a Compare March 17, 2025 12:24
@RayOffiah RayOffiah marked this pull request as draft March 21, 2025 08:15
@RayOffiah RayOffiah force-pushed the DOC-13093-Write-a-tutorial-for-SQL-migration branch from 1670e82 to 6d09e1a Compare April 2, 2025 14:41
@RayOffiah RayOffiah changed the title DOC-13093-Write-a-tutorial-for-SQL-migration DOC-13093-Write-a-tutorial-for-SQL-migration (Couchbase Server) Apr 3, 2025
@RayOffiah RayOffiah marked this pull request as ready for review April 3, 2025 12:42
@RayOffiah RayOffiah requested a review from simon-dew April 4, 2025 11:11
@RayOffiah RayOffiah force-pushed the DOC-13093-Write-a-tutorial-for-SQL-migration branch 2 times, most recently from 616109e to b949ede Compare April 4, 2025 11:43
@RayOffiah RayOffiah marked this pull request as draft April 4, 2025 13:19
@RayOffiah RayOffiah force-pushed the DOC-13093-Write-a-tutorial-for-SQL-migration branch 4 times, most recently from c91fc20 to 920b856 Compare April 8, 2025 09:09
Introduce a detailed migration guide for converting MySQL data to Couchbase Capella, including examples on transforming relational data into document models. Updates also include navigation links and reorganization of shared content for reuse between tutorials.

Add SQL to Capella migration tutorial

This commit introduces a new guide on migrating data from MySQL to Couchbase Capella, providing step-by-step instructions for users. Additionally, the navigation file has been updated to include a link to the new tutorial.

Rename SQL migration tutorial to specify Couchbase Server.

Update tutorial to specify MySQL and minimum version requirement

Clarify that the tutorial focuses on migrating data specifically from MySQL. Add a note requiring MySQL version 5.7.22 or later due to JSON function usage.

Minor grammar and style adjustments.

Add reference to MySQL JSON functions in the SQL migration guide

Provide a link to the MySQL JSON function reference for additional context and detailed information.

Changes for preview

Revised headers for consistency in cbimport guide and updated example JSON data in the SQL migration tutorial to better align with a new data model. Added detailed instructions and images for setting up buckets, scopes, collections, and importing data.

Update SQL migration tutorial with the document model and examples

Add detailed steps, diagrams, and JSON examples for migrating SQL data to a document model, including student and course data. Update the enrollment schema with a 'score' field and clarify how to structure JSON for Couchbase imports.

New tutorial page and addition to the navigation menu.
@RayOffiah RayOffiah force-pushed the DOC-13093-Write-a-tutorial-for-SQL-migration branch from f1f3ab0 to 581a45a Compare April 9, 2025 11:48
@RayOffiah RayOffiah marked this pull request as ready for review April 9, 2025 11:50
@RayOffiah RayOffiah requested a review from RichardSmedley April 9, 2025 11:51
@@ -0,0 +1,236 @@
= Migrating your Data from MySQL to Capella
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit confused about having the Capella tutorial here, in the release/7.6 branch.

Shouldn't just the Server version be here,
with the Capella one in the capella branch of docs-devex,
and them having equivalent places in the nav for their respective branches?

Copy link
Contributor Author

@RayOffiah RayOffiah Apr 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that does make a lot more sense. 🤔

I'll leave the other page where it is, move the Capella page to the Capella branch, and create a new PR.

If you're running through the examples,
then you will also need an existing MySQL installation with the preexisting table structure
defined in xref:student-record-sql-database-section[the following section].

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth mentioning that the examples assume a Unix-type OS, and if you're unfortunate enough to be running Windows you should adjust the file paths accordingly?

I don't have a strong opinion either way, but we've definitely had people ask for this in other docs - however, given WSL, and some ppl running Powershell and not WSL, actually providing an alternative is a bit of a non-starter. 😅

= Migrating your Data from MySQL to Capella
:description: Using MySQL as a starting point, this guide demonstrates \
how to migrate your existing data from SQL tables to a Couchbase Capella instance.
:page-topic-type: guide
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be type tutorial ?


Before you make a start, you will need a Capella instance to run the tutorial.
If you do not currently have an instance,
then you can create a Capella trial here =>{nbsp}https://www.couchbase.com/downloads/?family=capella[Capella Trial]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You used : in the Server version of the doc,
but => here.

Perhaps best to stick to just one?

include::partial$diagrams/student-record-erd.puml[]
....

which we will convert to a document model suitable for storage in our Couchbase bucket:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we change this so that this isolated line starts with a capital letter:

We will convert this table structure to a document model suitable for storage in our Couchbase bucket:



We can handle this JSON structure by using a more involved SELECT:
as well as extracting the student records, we can simultaneously pull in the enrollments for each student:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can handle this JSON structure by using a more involved SELECT.

As well as extracting the student records, we can simultaneously pull in the enrollments for each student:

read the sections on xref:manage:manage-buckets/bucket-management-overview.adoc[Managing Buckets]
and xref:manage:manage-scopes-and-collections/manage-scopes-and-collections.adoc[Managing Scopes and Collections]

'''
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't know we used this <hr /> type thing.
Interesting to see.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I've seen Sarah use it in a few places.

Copy link
Contributor

@RichardSmedley RichardSmedley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @RayOffiah
I think this mostly works well, and all but one of my comments is fairly trivial. 👍

However, I don't think we can merge until we look at why the Capella tutorial is alongside the self-managed one in the release/7.6 branch, instead of in the Capella docs, via devex's capella branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants